home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / rex.lha / rex / m2c / Tree0.c < prev    next >
C/C++ Source or Header  |  1992-08-18  |  33KB  |  1,373 lines

  1. #include "SYSTEM_.h"
  2.  
  3. #ifndef DEFINITION_General
  4. #include "General.h"
  5. #endif
  6.  
  7. #ifndef DEFINITION_Memory
  8. #include "Memory.h"
  9. #endif
  10.  
  11. #ifndef DEFINITION_DynArray
  12. #include "DynArray.h"
  13. #endif
  14.  
  15. #ifndef DEFINITION_IO
  16. #include "IO.h"
  17. #endif
  18.  
  19. #ifndef DEFINITION_Layout
  20. #include "Layout.h"
  21. #endif
  22.  
  23. #ifndef DEFINITION_StringMem
  24. #include "StringMem.h"
  25. #endif
  26.  
  27. #ifndef DEFINITION_Strings
  28. #include "Strings.h"
  29. #endif
  30.  
  31. #ifndef DEFINITION_Idents
  32. #include "Idents.h"
  33. #endif
  34.  
  35. #ifndef DEFINITION_Texts
  36. #include "Texts.h"
  37. #endif
  38.  
  39. #ifndef DEFINITION_Sets
  40. #include "Sets.h"
  41. #endif
  42.  
  43. #ifndef DEFINITION_Sets
  44. #include "Sets.h"
  45. #endif
  46.  
  47. #ifndef DEFINITION_Texts
  48. #include "Texts.h"
  49. #endif
  50.  
  51. #ifndef DEFINITION_StringMem
  52. #include "StringMem.h"
  53. #endif
  54.  
  55. #ifndef DEFINITION_Positions
  56. #include "Positions.h"
  57. #endif
  58.  
  59. #ifndef DEFINITION_Tree0
  60. #include "Tree0.h"
  61. #endif
  62.  
  63. Tree0_tTree0 Tree0_Tree0Root;
  64. LONGCARD Tree0_HeapUsed;
  65. ADDRESS Tree0_yyPoolFreePtr, Tree0_yyPoolMaxPtr;
  66. struct Tree0_16 Tree0_yyNodeSize;
  67.  
  68. #define yyBlockSize    20480
  69. typedef struct S_1 *yytBlockPtr;
  70. typedef struct S_1 {
  71.     struct S_2 {
  72.         CHAR A[yyBlockSize - 1 + 1];
  73.     } yyBlock;
  74.     yytBlockPtr yySuccessor;
  75. } yytBlock;
  76. static yytBlockPtr yyBlockList;
  77. static SHORTCARD yyMaxSize, yyi;
  78. static struct S_3 {
  79.     SHORTCARD A[13 + 1];
  80. } yyTypeRange;
  81. typedef Tree0_tTree0 *yyPtrtTree;
  82. static IO_tFile yyf;
  83. static SHORTCARD yyLabel;
  84. static SHORTCARD yyKind;
  85. static CHAR yyc;
  86. static Strings_tString yys;
  87. static void yyMark ARGS((Tree0_tTree0 yyt));
  88. #define yyInitTreeStoreSize    32
  89. static LONGINT yyTreeStoreSize;
  90. static struct S_4 {
  91.     Tree0_tTree0 A[50000 + 1];
  92. } *yyTreeStorePtr;
  93. static INTEGER yyLabelCount;
  94. static SHORTINT yyRecursionLevel;
  95. static SHORTCARD yyMapToLabel ARGS((Tree0_tTree0 yyTree));
  96. static Tree0_tTree0 yyMapToTree ARGS((SHORTCARD yyLabel));
  97. static void yyWriteNl ARGS(());
  98. static void yyWriteSelector ARGS((CHAR yys[], LONGCARD ));
  99. static void yyWriteHex ARGS((BYTE yyx[], LONGCARD ));
  100. static SHORTINT yyIndentLevel;
  101. static void yyIndentSelector ARGS((CHAR yys[], LONGCARD ));
  102. static void yyIndentSelectorTree ARGS((CHAR yys[], LONGCARD , Tree0_tTree0 yyt));
  103. static void yWriteNode ARGS((Tree0_tTree0 yyt));
  104. static void yWriteNode1 ARGS((Tree0_tTree0 yyt));
  105. static void yWriteOption ARGS((Tree0_tTree0 yyt));
  106. static void yWriteRepetition ARGS((Tree0_tTree0 yyt));
  107. static void yWriteNode2 ARGS((Tree0_tTree0 yyt));
  108. static void yWriteList ARGS((Tree0_tTree0 yyt));
  109. static void yWriteSequence ARGS((Tree0_tTree0 yyt));
  110. static void yWriteAlternative ARGS((Tree0_tTree0 yyt));
  111. static void yWriteCh ARGS((Tree0_tTree0 yyt));
  112. static void yWriteSet ARGS((Tree0_tTree0 yyt));
  113. static void yWriteString ARGS((Tree0_tTree0 yyt));
  114. static void yWriteRule ARGS((Tree0_tTree0 yyt));
  115. static void yWritePattern ARGS((Tree0_tTree0 yyt));
  116. static void yyWriteTree0 ARGS((Tree0_tTree0 yyt));
  117. #define yyNil    ((CHAR)'\374')
  118. #define yyNoLabel    ((CHAR)'\375')
  119. #define yyLabelDef    ((CHAR)'\376')
  120. #define yyLabelUse    ((CHAR)'\377')
  121. static Tree0_tProcTree yyProc;
  122. static void yyTraverseTree0TD ARGS((Tree0_tTree0 yyt));
  123.  
  124.  
  125. Tree0_tTree0 Tree0_yyAlloc
  126. # ifdef __STDC__
  127. ()
  128. # else
  129. ()
  130. # endif
  131. {
  132.   yytBlockPtr yyBlockPtr;
  133.  
  134.   yyBlockPtr = yyBlockList;
  135.   yyBlockList = (yytBlockPtr)Memory_Alloc((LONGINT)sizeof(yytBlock));
  136.   yyBlockList->yySuccessor = yyBlockPtr;
  137.   Tree0_yyPoolFreePtr = ADR(yyBlockList->yyBlock);
  138.   Tree0_yyPoolMaxPtr = (ADDRESS)(Tree0_yyPoolFreePtr + yyBlockSize - yyMaxSize + 1);
  139.   INC1(Tree0_HeapUsed, yyBlockSize);
  140.   return (Tree0_tTree0)Tree0_yyPoolFreePtr;
  141. }
  142.  
  143. Tree0_tTree0 Tree0_MakeTree0
  144. # ifdef __STDC__
  145. (SHORTCARD yyKind)
  146. # else
  147. (yyKind)
  148. SHORTCARD yyKind;
  149. # endif
  150. {
  151.   LONGINT yyByteCount;
  152.   Tree0_tTree0 yyt;
  153.  
  154.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  155.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  156.     yyt = Tree0_yyAlloc();
  157.   }
  158.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[yyKind]);
  159.   yyt->U_1.V_2.yyHead.yyMark = 0;
  160.   yyt->U_1.V_1.Kind = yyKind;
  161.   return yyt;
  162. }
  163.  
  164. BOOLEAN Tree0_IsType
  165. # ifdef __STDC__
  166. (Tree0_tTree0 yyTree, SHORTCARD yyKind)
  167. # else
  168. (yyTree, yyKind)
  169. Tree0_tTree0 yyTree;
  170. SHORTCARD yyKind;
  171. # endif
  172. {
  173.   return yyTree != Tree0_NoTree0 && yyKind <= yyTree->U_1.V_1.Kind && yyTree->U_1.V_1.Kind <= yyTypeRange.A[yyKind];
  174. }
  175.  
  176. Tree0_tTree0 Tree0_mNode
  177. # ifdef __STDC__
  178. ()
  179. # else
  180. ()
  181. # endif
  182. {
  183.   LONGINT yyByteCount;
  184.   Tree0_tTree0 yyt;
  185.  
  186.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  187.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  188.     yyt = Tree0_yyAlloc();
  189.   }
  190.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Node]);
  191.   yyt->U_1.V_2.yyHead.yyMark = 0;
  192.   yyt->U_1.V_1.Kind = Tree0_Node;
  193.   {
  194.     register Tree0_yNode *W_1 = &yyt->U_1.V_3.Node;
  195.  
  196.   }
  197.   return yyt;
  198. }
  199.  
  200. Tree0_tTree0 Tree0_mNode1
  201. # ifdef __STDC__
  202. (Tree0_tTree0 pSon1)
  203. # else
  204. (pSon1)
  205. Tree0_tTree0 pSon1;
  206. # endif
  207. {
  208.   LONGINT yyByteCount;
  209.   Tree0_tTree0 yyt;
  210.  
  211.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  212.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  213.     yyt = Tree0_yyAlloc();
  214.   }
  215.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Node1]);
  216.   yyt->U_1.V_2.yyHead.yyMark = 0;
  217.   yyt->U_1.V_1.Kind = Tree0_Node1;
  218.   {
  219.     register Tree0_yNode1 *W_2 = &yyt->U_1.V_4.Node1;
  220.  
  221.     W_2->Son1 = pSon1;
  222.   }
  223.   return yyt;
  224. }
  225.  
  226. Tree0_tTree0 Tree0_mOption
  227. # ifdef __STDC__
  228. (Tree0_tTree0 pSon1)
  229. # else
  230. (pSon1)
  231. Tree0_tTree0 pSon1;
  232. # endif
  233. {
  234.   LONGINT yyByteCount;
  235.   Tree0_tTree0 yyt;
  236.  
  237.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  238.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  239.     yyt = Tree0_yyAlloc();
  240.   }
  241.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Option]);
  242.   yyt->U_1.V_2.yyHead.yyMark = 0;
  243.   yyt->U_1.V_1.Kind = Tree0_Option;
  244.   {
  245.     register Tree0_yOption *W_3 = &yyt->U_1.V_5.Option;
  246.  
  247.     W_3->Son1 = pSon1;
  248.   }
  249.   return yyt;
  250. }
  251.  
  252. Tree0_tTree0 Tree0_mRepetition
  253. # ifdef __STDC__
  254. (Tree0_tTree0 pSon1)
  255. # else
  256. (pSon1)
  257. Tree0_tTree0 pSon1;
  258. # endif
  259. {
  260.   LONGINT yyByteCount;
  261.   Tree0_tTree0 yyt;
  262.  
  263.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  264.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  265.     yyt = Tree0_yyAlloc();
  266.   }
  267.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Repetition]);
  268.   yyt->U_1.V_2.yyHead.yyMark = 0;
  269.   yyt->U_1.V_1.Kind = Tree0_Repetition;
  270.   {
  271.     register Tree0_yRepetition *W_4 = &yyt->U_1.V_6.Repetition;
  272.  
  273.     W_4->Son1 = pSon1;
  274.   }
  275.   return yyt;
  276. }
  277.  
  278. Tree0_tTree0 Tree0_mNode2
  279. # ifdef __STDC__
  280. (Tree0_tTree0 pSon1, Tree0_tTree0 pSon2)
  281. # else
  282. (pSon1, pSon2)
  283. Tree0_tTree0 pSon1;
  284. Tree0_tTree0 pSon2;
  285. # endif
  286. {
  287.   LONGINT yyByteCount;
  288.   Tree0_tTree0 yyt;
  289.  
  290.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  291.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  292.     yyt = Tree0_yyAlloc();
  293.   }
  294.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Node2]);
  295.   yyt->U_1.V_2.yyHead.yyMark = 0;
  296.   yyt->U_1.V_1.Kind = Tree0_Node2;
  297.   {
  298.     register Tree0_yNode2 *W_5 = &yyt->U_1.V_7.Node2;
  299.  
  300.     W_5->Son1 = pSon1;
  301.     W_5->Son2 = pSon2;
  302.   }
  303.   return yyt;
  304. }
  305.  
  306. Tree0_tTree0 Tree0_mList
  307. # ifdef __STDC__
  308. (Tree0_tTree0 pSon1, Tree0_tTree0 pSon2)
  309. # else
  310. (pSon1, pSon2)
  311. Tree0_tTree0 pSon1;
  312. Tree0_tTree0 pSon2;
  313. # endif
  314. {
  315.   LONGINT yyByteCount;
  316.   Tree0_tTree0 yyt;
  317.  
  318.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  319.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  320.     yyt = Tree0_yyAlloc();
  321.   }
  322.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_List]);
  323.   yyt->U_1.V_2.yyHead.yyMark = 0;
  324.   yyt->U_1.V_1.Kind = Tree0_List;
  325.   {
  326.     register Tree0_yList *W_6 = &yyt->U_1.V_8.List;
  327.  
  328.     W_6->Son1 = pSon1;
  329.     W_6->Son2 = pSon2;
  330.   }
  331.   return yyt;
  332. }
  333.  
  334. Tree0_tTree0 Tree0_mSequence
  335. # ifdef __STDC__
  336. (Tree0_tTree0 pSon1, Tree0_tTree0 pSon2)
  337. # else
  338. (pSon1, pSon2)
  339. Tree0_tTree0 pSon1;
  340. Tree0_tTree0 pSon2;
  341. # endif
  342. {
  343.   LONGINT yyByteCount;
  344.   Tree0_tTree0 yyt;
  345.  
  346.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  347.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  348.     yyt = Tree0_yyAlloc();
  349.   }
  350.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Sequence]);
  351.   yyt->U_1.V_2.yyHead.yyMark = 0;
  352.   yyt->U_1.V_1.Kind = Tree0_Sequence;
  353.   {
  354.     register Tree0_ySequence *W_7 = &yyt->U_1.V_9.Sequence;
  355.  
  356.     W_7->Son1 = pSon1;
  357.     W_7->Son2 = pSon2;
  358.   }
  359.   return yyt;
  360. }
  361.  
  362. Tree0_tTree0 Tree0_mAlternative
  363. # ifdef __STDC__
  364. (Tree0_tTree0 pSon1, Tree0_tTree0 pSon2)
  365. # else
  366. (pSon1, pSon2)
  367. Tree0_tTree0 pSon1;
  368. Tree0_tTree0 pSon2;
  369. # endif
  370. {
  371.   LONGINT yyByteCount;
  372.   Tree0_tTree0 yyt;
  373.  
  374.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  375.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  376.     yyt = Tree0_yyAlloc();
  377.   }
  378.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Alternative]);
  379.   yyt->U_1.V_2.yyHead.yyMark = 0;
  380.   yyt->U_1.V_1.Kind = Tree0_Alternative;
  381.   {
  382.     register Tree0_yAlternative *W_8 = &yyt->U_1.V_10.Alternative;
  383.  
  384.     W_8->Son1 = pSon1;
  385.     W_8->Son2 = pSon2;
  386.   }
  387.   return yyt;
  388. }
  389.  
  390. Tree0_tTree0 Tree0_mCh
  391. # ifdef __STDC__
  392. (CHAR pCh)
  393. # else
  394. (pCh)
  395. CHAR pCh;
  396. # endif
  397. {
  398.   LONGINT yyByteCount;
  399.   Tree0_tTree0 yyt;
  400.  
  401.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  402.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  403.     yyt = Tree0_yyAlloc();
  404.   }
  405.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Ch]);
  406.   yyt->U_1.V_2.yyHead.yyMark = 0;
  407.   yyt->U_1.V_1.Kind = Tree0_Ch;
  408.   {
  409.     register Tree0_yCh *W_9 = &yyt->U_1.V_11.Ch;
  410.  
  411.     W_9->Ch = pCh;
  412.   }
  413.   return yyt;
  414. }
  415.  
  416. Tree0_tTree0 Tree0_mSet
  417. # ifdef __STDC__
  418. (Sets_tSet pSet)
  419. # else
  420. (pSet)
  421. Sets_tSet pSet;
  422. # endif
  423. {
  424.   LONGINT yyByteCount;
  425.   Tree0_tTree0 yyt;
  426.  
  427.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  428.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  429.     yyt = Tree0_yyAlloc();
  430.   }
  431.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Set]);
  432.   yyt->U_1.V_2.yyHead.yyMark = 0;
  433.   yyt->U_1.V_1.Kind = Tree0_Set;
  434.   {
  435.     register Tree0_ySet *W_10 = &yyt->U_1.V_12.Set;
  436.  
  437.     W_10->Set = pSet;
  438.   }
  439.   return yyt;
  440. }
  441.  
  442. Tree0_tTree0 Tree0_mString
  443. # ifdef __STDC__
  444. (StringMem_tStringRef pString)
  445. # else
  446. (pString)
  447. StringMem_tStringRef pString;
  448. # endif
  449. {
  450.   LONGINT yyByteCount;
  451.   Tree0_tTree0 yyt;
  452.  
  453.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  454.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  455.     yyt = Tree0_yyAlloc();
  456.   }
  457.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_String]);
  458.   yyt->U_1.V_2.yyHead.yyMark = 0;
  459.   yyt->U_1.V_1.Kind = Tree0_String;
  460.   {
  461.     register Tree0_yString *W_11 = &yyt->U_1.V_13.String;
  462.  
  463.     W_11->String = pString;
  464.   }
  465.   return yyt;
  466. }
  467.  
  468. Tree0_tTree0 Tree0_mRule
  469. # ifdef __STDC__
  470. (Tree0_tTree0 pPatterns, Texts_tText pTargetCode, SHORTCARD pLine, SHORTCARD pCodeMode, SHORTCARD pRuleNr)
  471. # else
  472. (pPatterns, pTargetCode, pLine, pCodeMode, pRuleNr)
  473. Tree0_tTree0 pPatterns;
  474. Texts_tText pTargetCode;
  475. SHORTCARD pLine;
  476. SHORTCARD pCodeMode;
  477. SHORTCARD pRuleNr;
  478. # endif
  479. {
  480.   LONGINT yyByteCount;
  481.   Tree0_tTree0 yyt;
  482.  
  483.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  484.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  485.     yyt = Tree0_yyAlloc();
  486.   }
  487.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Rule]);
  488.   yyt->U_1.V_2.yyHead.yyMark = 0;
  489.   yyt->U_1.V_1.Kind = Tree0_Rule;
  490.   {
  491.     register Tree0_yRule *W_12 = &yyt->U_1.V_14.Rule;
  492.  
  493.     W_12->Patterns = pPatterns;
  494.     W_12->TargetCode = pTargetCode;
  495.     W_12->Line = pLine;
  496.     W_12->CodeMode = pCodeMode;
  497.     W_12->RuleNr = pRuleNr;
  498.   }
  499.   return yyt;
  500. }
  501.  
  502. Tree0_tTree0 Tree0_mPattern
  503. # ifdef __STDC__
  504. (Sets_tSet pStartStates, Tree0_tTree0 pRegExpr, Tree0_tTree0 pRightContext, SHORTCARD pPatternNr, Positions_tPosition pPosition)
  505. # else
  506. (pStartStates, pRegExpr, pRightContext, pPatternNr, pPosition)
  507. Sets_tSet pStartStates;
  508. Tree0_tTree0 pRegExpr;
  509. Tree0_tTree0 pRightContext;
  510. SHORTCARD pPatternNr;
  511. Positions_tPosition pPosition;
  512. # endif
  513. {
  514.   LONGINT yyByteCount;
  515.   Tree0_tTree0 yyt;
  516.  
  517.   yyt = (Tree0_tTree0)Tree0_yyPoolFreePtr;
  518.   if ((ADDRESS)yyt >= Tree0_yyPoolMaxPtr) {
  519.     yyt = Tree0_yyAlloc();
  520.   }
  521.   INC1(Tree0_yyPoolFreePtr, Tree0_yyNodeSize.A[Tree0_Pattern]);
  522.   yyt->U_1.V_2.yyHead.yyMark = 0;
  523.   yyt->U_1.V_1.Kind = Tree0_Pattern;
  524.   {
  525.     register Tree0_yPattern *W_13 = &yyt->U_1.V_15.Pattern;
  526.  
  527.     W_13->StartStates = pStartStates;
  528.     W_13->RegExpr = pRegExpr;
  529.     W_13->RightContext = pRightContext;
  530.     W_13->PatternNr = pPatternNr;
  531.     W_13->Position = pPosition;
  532.   }
  533.   return yyt;
  534. }
  535.  
  536. static void yyMark
  537. # ifdef __STDC__
  538. (Tree0_tTree0 yyt)
  539. # else
  540. (yyt)
  541. Tree0_tTree0 yyt;
  542. # endif
  543. {
  544.   for (;;) {
  545.     if (yyt == Tree0_NoTree0) {
  546.       return;
  547.     }
  548.     INC(yyt->U_1.V_2.yyHead.yyMark);
  549.     if (yyt->U_1.V_2.yyHead.yyMark > 1) {
  550.       return;
  551.     }
  552.     switch (yyt->U_1.V_1.Kind) {
  553.     case Tree0_Node1:;
  554.       yyt = yyt->U_1.V_4.Node1.Son1;
  555.       break;
  556.     case Tree0_Option:;
  557.       yyt = yyt->U_1.V_5.Option.Son1;
  558.       break;
  559.     case Tree0_Repetition:;
  560.       yyt = yyt->U_1.V_6.Repetition.Son1;
  561.       break;
  562.     case Tree0_Node2:;
  563.       yyMark(yyt->U_1.V_7.Node2.Son1);
  564.       yyt = yyt->U_1.V_7.Node2.Son2;
  565.       break;
  566.     case Tree0_List:;
  567.       yyMark(yyt->U_1.V_8.List.Son1);
  568.       yyt = yyt->U_1.V_8.List.Son2;
  569.       break;
  570.     case Tree0_Sequence:;
  571.       yyMark(yyt->U_1.V_9.Sequence.Son1);
  572.       yyt = yyt->U_1.V_9.Sequence.Son2;
  573.       break;
  574.     case Tree0_Alternative:;
  575.       yyMark(yyt->U_1.V_10.Alternative.Son1);
  576.       yyt = yyt->U_1.V_10.Alternative.Son2;
  577.       break;
  578.     case Tree0_Rule:;
  579.       yyt = yyt->U_1.V_14.Rule.Patterns;
  580.       break;
  581.     case Tree0_Pattern:;
  582.       yyMark(yyt->U_1.V_15.Pattern.RegExpr);
  583.       yyt = yyt->U_1.V_15.Pattern.RightContext;
  584.       break;
  585.     default :
  586.       return;
  587.       break;
  588.     }
  589.   } EXIT_1:;
  590. }
  591.  
  592. static SHORTCARD yyMapToLabel
  593. # ifdef __STDC__
  594. (Tree0_tTree0 yyTree)
  595. # else
  596. (yyTree)
  597. Tree0_tTree0 yyTree;
  598. # endif
  599. {
  600.   INTEGER yyi;
  601.  
  602.   {
  603.     LONGINT B_1 = 1, B_2 = yyLabelCount;
  604.  
  605.     if (B_1 <= B_2)
  606.       for (yyi = B_1;; yyi += 1) {
  607.         if (yyTreeStorePtr->A[yyi] == yyTree) {
  608.           return yyi;
  609.         }
  610.         if (yyi >= B_2) break;
  611.       }
  612.   }
  613.   INC(yyLabelCount);
  614.   if (yyLabelCount == yyTreeStoreSize) {
  615.     DynArray_ExtendArray((ADDRESS *)&yyTreeStorePtr, &yyTreeStoreSize, (LONGINT)sizeof(Tree0_tTree0));
  616.   }
  617.   yyTreeStorePtr->A[yyLabelCount] = yyTree;
  618.   return yyLabelCount;
  619. }
  620.  
  621. static Tree0_tTree0 yyMapToTree
  622. # ifdef __STDC__
  623. (SHORTCARD yyLabel)
  624. # else
  625. (yyLabel)
  626. SHORTCARD yyLabel;
  627. # endif
  628. {
  629.   return yyTreeStorePtr->A[yyLabel];
  630. }
  631.  
  632. static void yyWriteNl
  633. # ifdef __STDC__
  634. ()
  635. # else
  636. ()
  637. # endif
  638. {
  639.   IO_WriteNl(yyf);
  640. }
  641.  
  642. static void yyWriteSelector
  643. # ifdef __STDC__
  644. (CHAR yys[], LONGCARD O_1)
  645. # else
  646. (yys, O_1)
  647. CHAR yys[];
  648. LONGCARD O_1;
  649. # endif
  650. {
  651.   OPEN_ARRAY_LOCALS
  652.  
  653.   ALLOC_OPEN_ARRAYS(O_1 * sizeof(CHAR), 1)
  654.   COPY_OPEN_ARRAY(yys, O_1, CHAR)
  655.   IO_WriteS(yyf, yys, O_1);
  656.   Layout_WriteSpaces(yyf, 15 - (INTEGER)(O_1 - 1));
  657.   IO_WriteS(yyf, (STRING)" = ", 3L);
  658.   FREE_OPEN_ARRAYS
  659. }
  660.  
  661. static void yyWriteHex
  662. # ifdef __STDC__
  663. (BYTE yyx[], LONGCARD O_2)
  664. # else
  665. (yyx, O_2)
  666. BYTE yyx[];
  667. LONGCARD O_2;
  668. # endif
  669. {
  670.   INTEGER yyi;
  671.  
  672.   {
  673.     LONGINT B_3 = 0, B_4 = (INTEGER)(O_2 - 1);
  674.  
  675.     if (B_3 <= B_4)
  676.       for (yyi = B_3;; yyi += 1) {
  677.         IO_WriteN(yyf, ORD((CHAR)yyx[yyi]), 2L, 16L);
  678.         IO_WriteC(yyf, ' ');
  679.         if (yyi >= B_4) break;
  680.       }
  681.   }
  682. }
  683.  
  684. void Tree0_WriteTree0
  685. # ifdef __STDC__
  686. (IO_tFile yyyf, Tree0_tTree0 yyt)
  687. # else
  688. (yyyf, yyt)
  689. IO_tFile yyyf;
  690. Tree0_tTree0 yyt;
  691. # endif
  692. {
  693.   SHORTINT yySaveLevel;
  694.  
  695.   yyf = yyyf;
  696.   if (yyRecursionLevel == 0) {
  697.     yyLabelCount = 0;
  698.   }
  699.   INC(yyRecursionLevel);
  700.   yyMark(yyt);
  701.   yySaveLevel = yyIndentLevel;
  702.   yyIndentLevel = 0;
  703.   yyWriteTree0(yyt);
  704.   yyIndentLevel = yySaveLevel;
  705.   DEC(yyRecursionLevel);
  706. }
  707.  
  708. static void yyIndentSelector
  709. # ifdef __STDC__
  710. (CHAR yys[], LONGCARD O_3)
  711. # else
  712. (yys, O_3)
  713. CHAR yys[];
  714. LONGCARD O_3;
  715. # endif
  716. {
  717.   OPEN_ARRAY_LOCALS
  718.  
  719.   ALLOC_OPEN_ARRAYS(O_3 * sizeof(CHAR), 1)
  720.   COPY_OPEN_ARRAY(yys, O_3, CHAR)
  721.   Layout_WriteSpaces(yyf, (LONGINT)yyIndentLevel);
  722.   yyWriteSelector(yys, O_3);
  723.   FREE_OPEN_ARRAYS
  724. }
  725.  
  726. static void yyIndentSelectorTree
  727. # ifdef __STDC__
  728. (CHAR yys[], LONGCARD O_4, Tree0_tTree0 yyt)
  729. # else
  730. (yys, O_4, yyt)
  731. CHAR yys[];
  732. LONGCARD O_4;
  733. Tree0_tTree0 yyt;
  734. # endif
  735. {
  736.   OPEN_ARRAY_LOCALS
  737.  
  738.   ALLOC_OPEN_ARRAYS(O_4 * sizeof(CHAR), 1)
  739.   COPY_OPEN_ARRAY(yys, O_4, CHAR)
  740.   yyIndentSelector(yys, O_4);
  741.   yyWriteTree0(yyt);
  742.   FREE_OPEN_ARRAYS
  743. }
  744.  
  745. static void yWriteNode
  746. # ifdef __STDC__
  747. (Tree0_tTree0 yyt)
  748. # else
  749. (yyt)
  750. Tree0_tTree0 yyt;
  751. # endif
  752. {
  753.   IO_WriteS(yyf, (STRING)"Node", 4L);
  754.   yyWriteNl();
  755.   yyIndentSelector((STRING)"Tree", 4L);
  756.   yyWriteHex((WORD *)&yyt->U_1.V_3.Node.Tree, (LONGCARD)sizeof(yyt->U_1.V_3.Node.Tree));
  757.   yyWriteNl();
  758.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  759.   IO_WriteB(yyf, yyt->U_1.V_3.Node.IsConstantRE);
  760.   yyWriteNl();
  761.   yyIndentSelector((STRING)"LeafCount", 9L);
  762.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_3.Node.LeafCount, 0L);
  763.   yyWriteNl();
  764.   yyIndentSelector((STRING)"NodeCount", 9L);
  765.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_3.Node.NodeCount, 0L);
  766.   yyWriteNl();
  767. }
  768.  
  769. static void yWriteNode1
  770. # ifdef __STDC__
  771. (Tree0_tTree0 yyt)
  772. # else
  773. (yyt)
  774. Tree0_tTree0 yyt;
  775. # endif
  776. {
  777.   IO_WriteS(yyf, (STRING)"Node1", 5L);
  778.   yyWriteNl();
  779.   yyIndentSelector((STRING)"Tree", 4L);
  780.   yyWriteHex((WORD *)&yyt->U_1.V_4.Node1.Tree, (LONGCARD)sizeof(yyt->U_1.V_4.Node1.Tree));
  781.   yyWriteNl();
  782.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  783.   IO_WriteB(yyf, yyt->U_1.V_4.Node1.IsConstantRE);
  784.   yyWriteNl();
  785.   yyIndentSelector((STRING)"LeafCount", 9L);
  786.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_4.Node1.LeafCount, 0L);
  787.   yyWriteNl();
  788.   yyIndentSelector((STRING)"NodeCount", 9L);
  789.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_4.Node1.NodeCount, 0L);
  790.   yyWriteNl();
  791. }
  792.  
  793. static void yWriteOption
  794. # ifdef __STDC__
  795. (Tree0_tTree0 yyt)
  796. # else
  797. (yyt)
  798. Tree0_tTree0 yyt;
  799. # endif
  800. {
  801.   IO_WriteS(yyf, (STRING)"Option", 6L);
  802.   yyWriteNl();
  803.   yyIndentSelector((STRING)"Tree", 4L);
  804.   yyWriteHex((WORD *)&yyt->U_1.V_5.Option.Tree, (LONGCARD)sizeof(yyt->U_1.V_5.Option.Tree));
  805.   yyWriteNl();
  806.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  807.   IO_WriteB(yyf, yyt->U_1.V_5.Option.IsConstantRE);
  808.   yyWriteNl();
  809.   yyIndentSelector((STRING)"LeafCount", 9L);
  810.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_5.Option.LeafCount, 0L);
  811.   yyWriteNl();
  812.   yyIndentSelector((STRING)"NodeCount", 9L);
  813.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_5.Option.NodeCount, 0L);
  814.   yyWriteNl();
  815. }
  816.  
  817. static void yWriteRepetition
  818. # ifdef __STDC__
  819. (Tree0_tTree0 yyt)
  820. # else
  821. (yyt)
  822. Tree0_tTree0 yyt;
  823. # endif
  824. {
  825.   IO_WriteS(yyf, (STRING)"Repetition", 10L);
  826.   yyWriteNl();
  827.   yyIndentSelector((STRING)"Tree", 4L);
  828.   yyWriteHex((WORD *)&yyt->U_1.V_6.Repetition.Tree, (LONGCARD)sizeof(yyt->U_1.V_6.Repetition.Tree));
  829.   yyWriteNl();
  830.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  831.   IO_WriteB(yyf, yyt->U_1.V_6.Repetition.IsConstantRE);
  832.   yyWriteNl();
  833.   yyIndentSelector((STRING)"LeafCount", 9L);
  834.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_6.Repetition.LeafCount, 0L);
  835.   yyWriteNl();
  836.   yyIndentSelector((STRING)"NodeCount", 9L);
  837.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_6.Repetition.NodeCount, 0L);
  838.   yyWriteNl();
  839. }
  840.  
  841. static void yWriteNode2
  842. # ifdef __STDC__
  843. (Tree0_tTree0 yyt)
  844. # else
  845. (yyt)
  846. Tree0_tTree0 yyt;
  847. # endif
  848. {
  849.   IO_WriteS(yyf, (STRING)"Node2", 5L);
  850.   yyWriteNl();
  851.   yyIndentSelector((STRING)"Tree", 4L);
  852.   yyWriteHex((WORD *)&yyt->U_1.V_7.Node2.Tree, (LONGCARD)sizeof(yyt->U_1.V_7.Node2.Tree));
  853.   yyWriteNl();
  854.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  855.   IO_WriteB(yyf, yyt->U_1.V_7.Node2.IsConstantRE);
  856.   yyWriteNl();
  857.   yyIndentSelector((STRING)"LeafCount", 9L);
  858.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_7.Node2.LeafCount, 0L);
  859.   yyWriteNl();
  860.   yyIndentSelector((STRING)"NodeCount", 9L);
  861.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_7.Node2.NodeCount, 0L);
  862.   yyWriteNl();
  863.   yyIndentSelectorTree((STRING)"Son1", 4L, yyt->U_1.V_7.Node2.Son1);
  864. }
  865.  
  866. static void yWriteList
  867. # ifdef __STDC__
  868. (Tree0_tTree0 yyt)
  869. # else
  870. (yyt)
  871. Tree0_tTree0 yyt;
  872. # endif
  873. {
  874.   IO_WriteS(yyf, (STRING)"List", 4L);
  875.   yyWriteNl();
  876.   yyIndentSelector((STRING)"Tree", 4L);
  877.   yyWriteHex((WORD *)&yyt->U_1.V_8.List.Tree, (LONGCARD)sizeof(yyt->U_1.V_8.List.Tree));
  878.   yyWriteNl();
  879.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  880.   IO_WriteB(yyf, yyt->U_1.V_8.List.IsConstantRE);
  881.   yyWriteNl();
  882.   yyIndentSelector((STRING)"LeafCount", 9L);
  883.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_8.List.LeafCount, 0L);
  884.   yyWriteNl();
  885.   yyIndentSelector((STRING)"NodeCount", 9L);
  886.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_8.List.NodeCount, 0L);
  887.   yyWriteNl();
  888.   yyIndentSelectorTree((STRING)"Son1", 4L, yyt->U_1.V_8.List.Son1);
  889. }
  890.  
  891. static void yWriteSequence
  892. # ifdef __STDC__
  893. (Tree0_tTree0 yyt)
  894. # else
  895. (yyt)
  896. Tree0_tTree0 yyt;
  897. # endif
  898. {
  899.   IO_WriteS(yyf, (STRING)"Sequence", 8L);
  900.   yyWriteNl();
  901.   yyIndentSelector((STRING)"Tree", 4L);
  902.   yyWriteHex((WORD *)&yyt->U_1.V_9.Sequence.Tree, (LONGCARD)sizeof(yyt->U_1.V_9.Sequence.Tree));
  903.   yyWriteNl();
  904.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  905.   IO_WriteB(yyf, yyt->U_1.V_9.Sequence.IsConstantRE);
  906.   yyWriteNl();
  907.   yyIndentSelector((STRING)"LeafCount", 9L);
  908.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_9.Sequence.LeafCount, 0L);
  909.   yyWriteNl();
  910.   yyIndentSelector((STRING)"NodeCount", 9L);
  911.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_9.Sequence.NodeCount, 0L);
  912.   yyWriteNl();
  913.   yyIndentSelectorTree((STRING)"Son1", 4L, yyt->U_1.V_9.Sequence.Son1);
  914. }
  915.  
  916. static void yWriteAlternative
  917. # ifdef __STDC__
  918. (Tree0_tTree0 yyt)
  919. # else
  920. (yyt)
  921. Tree0_tTree0 yyt;
  922. # endif
  923. {
  924.   IO_WriteS(yyf, (STRING)"Alternative", 11L);
  925.   yyWriteNl();
  926.   yyIndentSelector((STRING)"Tree", 4L);
  927.   yyWriteHex((WORD *)&yyt->U_1.V_10.Alternative.Tree, (LONGCARD)sizeof(yyt->U_1.V_10.Alternative.Tree));
  928.   yyWriteNl();
  929.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  930.   IO_WriteB(yyf, yyt->U_1.V_10.Alternative.IsConstantRE);
  931.   yyWriteNl();
  932.   yyIndentSelector((STRING)"LeafCount", 9L);
  933.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_10.Alternative.LeafCount, 0L);
  934.   yyWriteNl();
  935.   yyIndentSelector((STRING)"NodeCount", 9L);
  936.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_10.Alternative.NodeCount, 0L);
  937.   yyWriteNl();
  938.   yyIndentSelectorTree((STRING)"Son1", 4L, yyt->U_1.V_10.Alternative.Son1);
  939. }
  940.  
  941. static void yWriteCh
  942. # ifdef __STDC__
  943. (Tree0_tTree0 yyt)
  944. # else
  945. (yyt)
  946. Tree0_tTree0 yyt;
  947. # endif
  948. {
  949.   IO_WriteS(yyf, (STRING)"Ch", 2L);
  950.   yyWriteNl();
  951.   yyIndentSelector((STRING)"Tree", 4L);
  952.   yyWriteHex((WORD *)&yyt->U_1.V_11.Ch.Tree, (LONGCARD)sizeof(yyt->U_1.V_11.Ch.Tree));
  953.   yyWriteNl();
  954.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  955.   IO_WriteB(yyf, yyt->U_1.V_11.Ch.IsConstantRE);
  956.   yyWriteNl();
  957.   yyIndentSelector((STRING)"LeafCount", 9L);
  958.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_11.Ch.LeafCount, 0L);
  959.   yyWriteNl();
  960.   yyIndentSelector((STRING)"NodeCount", 9L);
  961.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_11.Ch.NodeCount, 0L);
  962.   yyWriteNl();
  963.   yyIndentSelector((STRING)"Ch", 2L);
  964.   IO_WriteC(yyf, yyt->U_1.V_11.Ch.Ch);
  965.   yyWriteNl();
  966. }
  967.  
  968. static void yWriteSet
  969. # ifdef __STDC__
  970. (Tree0_tTree0 yyt)
  971. # else
  972. (yyt)
  973. Tree0_tTree0 yyt;
  974. # endif
  975. {
  976.   IO_WriteS(yyf, (STRING)"Set", 3L);
  977.   yyWriteNl();
  978.   yyIndentSelector((STRING)"Tree", 4L);
  979.   yyWriteHex((WORD *)&yyt->U_1.V_12.Set.Tree, (LONGCARD)sizeof(yyt->U_1.V_12.Set.Tree));
  980.   yyWriteNl();
  981.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  982.   IO_WriteB(yyf, yyt->U_1.V_12.Set.IsConstantRE);
  983.   yyWriteNl();
  984.   yyIndentSelector((STRING)"LeafCount", 9L);
  985.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_12.Set.LeafCount, 0L);
  986.   yyWriteNl();
  987.   yyIndentSelector((STRING)"NodeCount", 9L);
  988.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_12.Set.NodeCount, 0L);
  989.   yyWriteNl();
  990.   yyIndentSelector((STRING)"Set", 3L);
  991.   Sets_WriteSet(yyf, yyt->U_1.V_12.Set.Set);
  992.   yyWriteNl();
  993.   yyIndentSelector((STRING)"card", 4L);
  994.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_12.Set.card, 0L);
  995.   yyWriteNl();
  996. }
  997.  
  998. static void yWriteString
  999. # ifdef __STDC__
  1000. (Tree0_tTree0 yyt)
  1001. # else
  1002. (yyt)
  1003. Tree0_tTree0 yyt;
  1004. # endif
  1005. {
  1006.   IO_WriteS(yyf, (STRING)"String", 6L);
  1007.   yyWriteNl();
  1008.   yyIndentSelector((STRING)"Tree", 4L);
  1009.   yyWriteHex((WORD *)&yyt->U_1.V_13.String.Tree, (LONGCARD)sizeof(yyt->U_1.V_13.String.Tree));
  1010.   yyWriteNl();
  1011.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  1012.   IO_WriteB(yyf, yyt->U_1.V_13.String.IsConstantRE);
  1013.   yyWriteNl();
  1014.   yyIndentSelector((STRING)"LeafCount", 9L);
  1015.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_13.String.LeafCount, 0L);
  1016.   yyWriteNl();
  1017.   yyIndentSelector((STRING)"NodeCount", 9L);
  1018.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_13.String.NodeCount, 0L);
  1019.   yyWriteNl();
  1020.   yyIndentSelector((STRING)"String", 6L);
  1021.   StringMem_WriteString(yyf, yyt->U_1.V_13.String.String);
  1022.   yyWriteNl();
  1023. }
  1024.  
  1025. static void yWriteRule
  1026. # ifdef __STDC__
  1027. (Tree0_tTree0 yyt)
  1028. # else
  1029. (yyt)
  1030. Tree0_tTree0 yyt;
  1031. # endif
  1032. {
  1033.   IO_WriteS(yyf, (STRING)"Rule", 4L);
  1034.   yyWriteNl();
  1035.   yyIndentSelector((STRING)"Tree", 4L);
  1036.   yyWriteHex((WORD *)&yyt->U_1.V_14.Rule.Tree, (LONGCARD)sizeof(yyt->U_1.V_14.Rule.Tree));
  1037.   yyWriteNl();
  1038.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  1039.   IO_WriteB(yyf, yyt->U_1.V_14.Rule.IsConstantRE);
  1040.   yyWriteNl();
  1041.   yyIndentSelector((STRING)"LeafCount", 9L);
  1042.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_14.Rule.LeafCount, 0L);
  1043.   yyWriteNl();
  1044.   yyIndentSelector((STRING)"NodeCount", 9L);
  1045.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_14.Rule.NodeCount, 0L);
  1046.   yyWriteNl();
  1047.   yyIndentSelector((STRING)"TargetCode", 10L);
  1048.   Texts_WriteText(yyf, yyt->U_1.V_14.Rule.TargetCode);
  1049.   yyWriteNl();
  1050.   yyIndentSelector((STRING)"Line", 4L);
  1051.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_14.Rule.Line, 0L);
  1052.   yyWriteNl();
  1053.   yyIndentSelector((STRING)"CodeMode", 8L);
  1054.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_14.Rule.CodeMode, 0L);
  1055.   yyWriteNl();
  1056.   yyIndentSelector((STRING)"RuleNr", 6L);
  1057.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_14.Rule.RuleNr, 0L);
  1058.   yyWriteNl();
  1059. }
  1060.  
  1061. static void yWritePattern
  1062. # ifdef __STDC__
  1063. (Tree0_tTree0 yyt)
  1064. # else
  1065. (yyt)
  1066. Tree0_tTree0 yyt;
  1067. # endif
  1068. {
  1069.   IO_WriteS(yyf, (STRING)"Pattern", 7L);
  1070.   yyWriteNl();
  1071.   yyIndentSelector((STRING)"Tree", 4L);
  1072.   yyWriteHex((WORD *)&yyt->U_1.V_15.Pattern.Tree, (LONGCARD)sizeof(yyt->U_1.V_15.Pattern.Tree));
  1073.   yyWriteNl();
  1074.   yyIndentSelector((STRING)"IsConstantRE", 12L);
  1075.   IO_WriteB(yyf, yyt->U_1.V_15.Pattern.IsConstantRE);
  1076.   yyWriteNl();
  1077.   yyIndentSelector((STRING)"LeafCount", 9L);
  1078.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_15.Pattern.LeafCount, 0L);
  1079.   yyWriteNl();
  1080.   yyIndentSelector((STRING)"NodeCount", 9L);
  1081.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_15.Pattern.NodeCount, 0L);
  1082.   yyWriteNl();
  1083.   yyIndentSelector((STRING)"StartStates", 11L);
  1084.   Sets_WriteSet(yyf, yyt->U_1.V_15.Pattern.StartStates);
  1085.   yyWriteNl();
  1086.   yyIndentSelectorTree((STRING)"RegExpr", 7L, yyt->U_1.V_15.Pattern.RegExpr);
  1087.   yyIndentSelector((STRING)"PatternNr", 9L);
  1088.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_15.Pattern.PatternNr, 0L);
  1089.   yyWriteNl();
  1090.   yyIndentSelector((STRING)"Position", 8L);
  1091.   yyWriteHex((WORD *)&yyt->U_1.V_15.Pattern.Position, (LONGCARD)sizeof(yyt->U_1.V_15.Pattern.Position));
  1092.   yyWriteNl();
  1093.   yyIndentSelector((STRING)"card", 4L);
  1094.   IO_WriteI(yyf, (LONGINT)yyt->U_1.V_15.Pattern.card, 0L);
  1095.   yyWriteNl();
  1096. }
  1097.  
  1098. static void yyWriteTree0
  1099. # ifdef __STDC__
  1100. (Tree0_tTree0 yyt)
  1101. # else
  1102. (yyt)
  1103. Tree0_tTree0 yyt;
  1104. # endif
  1105. {
  1106.   SHORTCARD yyLevel;
  1107.  
  1108.   yyLevel = yyIndentLevel;
  1109.   for (;;) {
  1110.     if (yyt == Tree0_NoTree0) {
  1111.       IO_WriteS(yyf, (STRING)" NoTree0", 8L);
  1112.       yyWriteNl();
  1113.       goto EXIT_2;
  1114.     } else if (yyt->U_1.V_2.yyHead.yyMark == 0) {
  1115.       IO_WriteC(yyf, '^');
  1116.       IO_WriteI(yyf, (LONGINT)yyMapToLabel(yyt), 0L);
  1117.       yyWriteNl();
  1118.       goto EXIT_2;
  1119.     } else if (yyt->U_1.V_2.yyHead.yyMark > 1) {
  1120.       yyWriteNl();
  1121.       IO_WriteN(yyf, (LONGCARD)yyMapToLabel(yyt), 6L, 10L);
  1122.       IO_WriteC(yyf, ':');
  1123.       Layout_WriteSpaces(yyf, (LONGINT)(yyIndentLevel - 7));
  1124.     } else {
  1125.       IO_WriteC(yyf, ' ');
  1126.     }
  1127.     yyt->U_1.V_2.yyHead.yyMark = 0;
  1128.     INC1(yyIndentLevel, 2);
  1129.     switch (yyt->U_1.V_1.Kind) {
  1130.     case Tree0_Node:;
  1131.       yWriteNode(yyt);
  1132.       goto EXIT_2;
  1133.       break;
  1134.     case Tree0_Node1:;
  1135.       yWriteNode1(yyt);
  1136.       yyIndentSelector((STRING)"Son1", 4L);
  1137.       yyt = yyt->U_1.V_4.Node1.Son1;
  1138.       break;
  1139.     case Tree0_Option:;
  1140.       yWriteOption(yyt);
  1141.       yyIndentSelector((STRING)"Son1", 4L);
  1142.       yyt = yyt->U_1.V_5.Option.Son1;
  1143.       break;
  1144.     case Tree0_Repetition:;
  1145.       yWriteRepetition(yyt);
  1146.       yyIndentSelector((STRING)"Son1", 4L);
  1147.       yyt = yyt->U_1.V_6.Repetition.Son1;
  1148.       break;
  1149.     case Tree0_Node2:;
  1150.       yWriteNode2(yyt);
  1151.       yyIndentSelector((STRING)"Son2", 4L);
  1152.       yyt = yyt->U_1.V_7.Node2.Son2;
  1153.       break;
  1154.     case Tree0_List:;
  1155.       yWriteList(yyt);
  1156.       yyIndentSelector((STRING)"Son2", 4L);
  1157.       yyt = yyt->U_1.V_8.List.Son2;
  1158.       break;
  1159.     case Tree0_Sequence:;
  1160.       yWriteSequence(yyt);
  1161.       yyIndentSelector((STRING)"Son2", 4L);
  1162.       yyt = yyt->U_1.V_9.Sequence.Son2;
  1163.       break;
  1164.     case Tree0_Alternative:;
  1165.       yWriteAlternative(yyt);
  1166.       yyIndentSelector((STRING)"Son2", 4L);
  1167.       yyt = yyt->U_1.V_10.Alternative.Son2;
  1168.       break;
  1169.     case Tree0_Ch:;
  1170.       yWriteCh(yyt);
  1171.       goto EXIT_2;
  1172.       break;
  1173.     case Tree0_Set:;
  1174.       yWriteSet(yyt);
  1175.       goto EXIT_2;
  1176.       break;
  1177.     case Tree0_String:;
  1178.       yWriteString(yyt);
  1179.       goto EXIT_2;
  1180.       break;
  1181.     case Tree0_Rule:;
  1182.       yWriteRule(yyt);
  1183.       yyIndentSelector((STRING)"Patterns", 8L);
  1184.       yyt = yyt->U_1.V_14.Rule.Patterns;
  1185.       break;
  1186.     case Tree0_Pattern:;
  1187.       yWritePattern(yyt);
  1188.       yyIndentSelector((STRING)"RightContext", 12L);
  1189.       yyt = yyt->U_1.V_15.Pattern.RightContext;
  1190.       break;
  1191.     default :
  1192.       goto EXIT_2;
  1193.       break;
  1194.     }
  1195.   } EXIT_2:;
  1196.   yyIndentLevel = yyLevel;
  1197. }
  1198.  
  1199. void Tree0_ReleaseTree0Module
  1200. # ifdef __STDC__
  1201. ()
  1202. # else
  1203. ()
  1204. # endif
  1205. {
  1206.   yytBlockPtr yyBlockPtr;
  1207.  
  1208.   while (yyBlockList != NIL) {
  1209.     yyBlockPtr = yyBlockList;
  1210.     yyBlockList = yyBlockList->yySuccessor;
  1211.     Memory_Free((LONGINT)sizeof(yytBlock), (ADDRESS)yyBlockPtr);
  1212.   }
  1213.   Tree0_yyPoolFreePtr = (ADDRESS)NIL;
  1214.   Tree0_yyPoolMaxPtr = (ADDRESS)NIL;
  1215.   Tree0_HeapUsed = 0;
  1216. }
  1217.  
  1218. void Tree0_TraverseTree0TD
  1219. # ifdef __STDC__
  1220. (Tree0_tTree0 yyt, Tree0_tProcTree yyyProc)
  1221. # else
  1222. (yyt, yyyProc)
  1223. Tree0_tTree0 yyt;
  1224. Tree0_tProcTree yyyProc;
  1225. # endif
  1226. {
  1227.   yyMark(yyt);
  1228.   yyProc = yyyProc;
  1229.   yyTraverseTree0TD(yyt);
  1230. }
  1231.  
  1232. static void yyTraverseTree0TD
  1233. # ifdef __STDC__
  1234. (Tree0_tTree0 yyt)
  1235. # else
  1236. (yyt)
  1237. Tree0_tTree0 yyt;
  1238. # endif
  1239. {
  1240.   for (;;) {
  1241.     if (yyt == Tree0_NoTree0 || yyt->U_1.V_2.yyHead.yyMark == 0) {
  1242.       return;
  1243.     }
  1244.     yyt->U_1.V_2.yyHead.yyMark = 0;
  1245.     (*yyProc)(yyt);
  1246.     switch (yyt->U_1.V_1.Kind) {
  1247.     case Tree0_Node1:;
  1248.       yyt = yyt->U_1.V_4.Node1.Son1;
  1249.       break;
  1250.     case Tree0_Option:;
  1251.       yyt = yyt->U_1.V_5.Option.Son1;
  1252.       break;
  1253.     case Tree0_Repetition:;
  1254.       yyt = yyt->U_1.V_6.Repetition.Son1;
  1255.       break;
  1256.     case Tree0_Node2:;
  1257.       yyTraverseTree0TD(yyt->U_1.V_7.Node2.Son1);
  1258.       yyt = yyt->U_1.V_7.Node2.Son2;
  1259.       break;
  1260.     case Tree0_List:;
  1261.       yyTraverseTree0TD(yyt->U_1.V_8.List.Son1);
  1262.       yyt = yyt->U_1.V_8.List.Son2;
  1263.       break;
  1264.     case Tree0_Sequence:;
  1265.       yyTraverseTree0TD(yyt->U_1.V_9.Sequence.Son1);
  1266.       yyt = yyt->U_1.V_9.Sequence.Son2;
  1267.       break;
  1268.     case Tree0_Alternative:;
  1269.       yyTraverseTree0TD(yyt->U_1.V_10.Alternative.Son1);
  1270.       yyt = yyt->U_1.V_10.Alternative.Son2;
  1271.       break;
  1272.     case Tree0_Rule:;
  1273.       yyt = yyt->U_1.V_14.Rule.Patterns;
  1274.       break;
  1275.     case Tree0_Pattern:;
  1276.       yyTraverseTree0TD(yyt->U_1.V_15.Pattern.RegExpr);
  1277.       yyt = yyt->U_1.V_15.Pattern.RightContext;
  1278.       break;
  1279.     default :
  1280.       return;
  1281.       break;
  1282.     }
  1283.   } EXIT_3:;
  1284. }
  1285.  
  1286. void Tree0_BeginTree0
  1287. # ifdef __STDC__
  1288. ()
  1289. # else
  1290. ()
  1291. # endif
  1292. {
  1293. }
  1294.  
  1295. void Tree0_CloseTree0
  1296. # ifdef __STDC__
  1297. ()
  1298. # else
  1299. ()
  1300. # endif
  1301. {
  1302. }
  1303.  
  1304. void BEGIN_Tree0()
  1305. {
  1306.   static BOOLEAN has_been_called = FALSE;
  1307.  
  1308.   if (!has_been_called) {
  1309.     has_been_called = TRUE;
  1310.  
  1311.     BEGIN_IO();
  1312.     BEGIN_Sets();
  1313.     BEGIN_Texts();
  1314.     BEGIN_StringMem();
  1315.     BEGIN_Positions();
  1316.     BEGIN_Tree();
  1317.     BEGIN_General();
  1318.     BEGIN_Memory();
  1319.     BEGIN_DynArray();
  1320.     BEGIN_IO();
  1321.     BEGIN_Layout();
  1322.     BEGIN_StringMem();
  1323.     BEGIN_Strings();
  1324.     BEGIN_Idents();
  1325.     BEGIN_Texts();
  1326.     BEGIN_Sets();
  1327.     BEGIN_Sets();
  1328.     BEGIN_Texts();
  1329.     BEGIN_StringMem();
  1330.     BEGIN_Positions();
  1331.  
  1332.     yyBlockList = NIL;
  1333.     Tree0_yyPoolFreePtr = (ADDRESS)NIL;
  1334.     Tree0_yyPoolMaxPtr = (ADDRESS)NIL;
  1335.     Tree0_HeapUsed = 0;
  1336.     Tree0_yyNodeSize.A[Tree0_Node] = sizeof(Tree0_yNode);
  1337.     Tree0_yyNodeSize.A[Tree0_Node1] = sizeof(Tree0_yNode1);
  1338.     Tree0_yyNodeSize.A[Tree0_Option] = sizeof(Tree0_yOption);
  1339.     Tree0_yyNodeSize.A[Tree0_Repetition] = sizeof(Tree0_yRepetition);
  1340.     Tree0_yyNodeSize.A[Tree0_Node2] = sizeof(Tree0_yNode2);
  1341.     Tree0_yyNodeSize.A[Tree0_List] = sizeof(Tree0_yList);
  1342.     Tree0_yyNodeSize.A[Tree0_Sequence] = sizeof(Tree0_ySequence);
  1343.     Tree0_yyNodeSize.A[Tree0_Alternative] = sizeof(Tree0_yAlternative);
  1344.     Tree0_yyNodeSize.A[Tree0_Ch] = sizeof(Tree0_yCh);
  1345.     Tree0_yyNodeSize.A[Tree0_Set] = sizeof(Tree0_ySet);
  1346.     Tree0_yyNodeSize.A[Tree0_String] = sizeof(Tree0_yString);
  1347.     Tree0_yyNodeSize.A[Tree0_Rule] = sizeof(Tree0_yRule);
  1348.     Tree0_yyNodeSize.A[Tree0_Pattern] = sizeof(Tree0_yPattern);
  1349.     yyMaxSize = 0;
  1350.     for (yyi = 1; yyi <= 13; yyi += 1) {
  1351.       Tree0_yyNodeSize.A[yyi] = (LONGINT)((BITSET)(Tree0_yyNodeSize.A[yyi] + (CARDINAL)General_MaxAlign - 1) & General_AlignMasks.A[General_MaxAlign]);
  1352.       yyMaxSize = General_Max((LONGINT)Tree0_yyNodeSize.A[yyi], (LONGINT)yyMaxSize);
  1353.     }
  1354.     yyTypeRange.A[Tree0_Node] = Tree0_Pattern;
  1355.     yyTypeRange.A[Tree0_Node1] = Tree0_Repetition;
  1356.     yyTypeRange.A[Tree0_Option] = Tree0_Option;
  1357.     yyTypeRange.A[Tree0_Repetition] = Tree0_Repetition;
  1358.     yyTypeRange.A[Tree0_Node2] = Tree0_Alternative;
  1359.     yyTypeRange.A[Tree0_List] = Tree0_List;
  1360.     yyTypeRange.A[Tree0_Sequence] = Tree0_Sequence;
  1361.     yyTypeRange.A[Tree0_Alternative] = Tree0_Alternative;
  1362.     yyTypeRange.A[Tree0_Ch] = Tree0_Ch;
  1363.     yyTypeRange.A[Tree0_Set] = Tree0_Set;
  1364.     yyTypeRange.A[Tree0_String] = Tree0_String;
  1365.     yyTypeRange.A[Tree0_Rule] = Tree0_Rule;
  1366.     yyTypeRange.A[Tree0_Pattern] = Tree0_Pattern;
  1367.     yyRecursionLevel = 0;
  1368.     yyTreeStoreSize = yyInitTreeStoreSize;
  1369.     DynArray_MakeArray((ADDRESS *)&yyTreeStorePtr, &yyTreeStoreSize, (LONGINT)sizeof(Tree0_tTree0));
  1370.     Tree0_BeginTree0();
  1371.   }
  1372. }
  1373.